'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)

	const db = uniCloud.database({})
	const shop = db.collection("db_shop_addr")
	//返回数据给客户端
	console.log(event)
	let dd;
	if (event.aflat) {
		await shop.where({
			aflat: true
		}).update({
			aflat: false
		})
	}

	await shop.add(event).then((res) => {
		console.log(res, "res")
		dd = res
	})
	return dd
};